package org.djw.hrm.feign.client;

import feign.hystrix.FallbackFactory;
import org.djw.hrm.domain.Login;
import org.djw.hrm.domain.MealAndLogin;
import org.djw.util.AjaxResult;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class AuthFeignClientFallbackFactory implements FallbackFactory<AuthFeignClient> {

    @Override
    public AuthFeignClient create(Throwable throwable) {
        return new AuthFeignClient() {
            //降级方法
            @Override
            public Login getByUsername(String username) {
                return null;
            }

            @Override
            public AjaxResult save(Login login) {
                return null;
            }

            @Override
            public void saveMealAndLogin(MealAndLogin mealAndLogin) {

            }
        };
    }
}
